import request from 'src/utils/request'

const base_2 = import.meta.env.DEV ? 'http://localhost:3019/shenwenyi' : ''

// 巡检点位table表格的api
export function pointList(data) {
    return request({
        url: '/serve/patrolLocation/list',
        method: 'post',
        data
    })

    // return Promise.resolve({
    //     data: {
    //         records: [
    //             {
    //                 productNo: 11,
    //                 merchantName:'项目名称',
    //                 categoryName:'所属公司',
    //                 type:'创建时间'
    //             }
    //             // ids:[11,12,13], let ids= this.multipleSelection.map(x=>{return x.id})
    //             // idStr:"11,12,13" 1.let ids= this.multipleSelection.map(x=>{return x.id})
    //                                 // 2.idStr=ids.join(',')
    //         ],
    //         total: 10
    //     }
    // })
    
}

// 获取项目管理列表数据
export function projectList(data) {
    return request({
        url: '/resource/village/query',
        method: 'post',
        data
    })
}

// 巡检点位删除
export function pointDelete(data) {
    return request({
        url: '/serve/patrolLocation/del',
        // url: base_2 + '/serve/patrolLocation/del',
        method: 'post',
        data
    })
}

// 查询点位是否有任务
export function checkIfPatrol(data) {
    return request({
        url: '/serve/patrolLocation/check',
        // url: base_2+'/serve/patrolLocation/check',
        method: 'post',
        data,
    })
}

// 有点位任务时的删除
export function isHaveWorkDelete(data) {
    return request({
        url: '/serve/patrolLocation/delWorkByLocation',
        // url: base_2+'/serve/patrolLocation/delWorkByLocation',
        method: 'post',
        data,
    })
}

// 生成点位码
export function downLoadCode(data) {
    return request({
        url: '/serve/patrolLocation/add',
        method: 'post',
        data,
        type:'export'
    })
}

// 下载点位吗
export function serveCode(data) {
    return request({
        url: '/serve/patrolLocation/download',
        method: 'post',
        data,
        type:'export'
    })
}



